<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function pjz() {
            let pj = 0
            let pjh = []
            let a = [+prompt("请输入最小值"), +prompt("请输入最大值")]
            for (i = a[0]; i <= a[1]; i++) {
                pjh.push(i)
                pj += i
            }
            let pjz = pj / pjh.length
            return`
                最小值${a[0]}<br>
                最大值${a[1]}<br>
                平均值${pjz}
            `
        }
        document.write(pjz())

    </script>
</body>

</html>